<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions"prefix="fn" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="cn">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>标签页面</title>
<%@ include file="../include/include.jsp"%>
<script type="text/javascript" src="./js/lazyload/lazyload_src.js"></script>
<script type="text/javascript" src="./js/fg/commodity/commodity.js"></script>
<script type="text/javascript">
$(document).ready(function() {
	var lableName = $("#lableName").val();
	var url = "index_commodity_loadCommodityInfo.htm?lableName="+encodeURI(encodeURI(lableName));
	commodity.loadCommodityInfo(url);
});

function dealLaleRelation(type){
	$.ajax({
	   type: "POST",
	   dataType:'json',
	   cache:false,
	   url: "tag_tag_addOrCanel.htm",
	   data:{type:type,lableName:$("#lableName").val(),time:new Date()},
	   success:function(data){
	   	 if(data.result){
	   	 	if('cancel'==type){
	   	 		$(".wrapper-content .addorcancel").removeClass("followed").addClass("follow").attr('onclick',"dealLaleRelation('add')");
	   	 	}else{
	   	 		$(".wrapper-content .addorcancel").removeClass("follow").addClass("followed").attr('onclick',"dealLaleRelation('cancel')");
	   	 	}
	   	 }else{
	   	 	alert("处理失败，请重新再试");
	   	 }
	   }
	});
}
</script>
</head>

<body style="overflow: inherit;" class="no-subnav page-home">
<input type="hidden" id="lableName" name="lableName" value="${lableName}">
<c:import url="../include/default_head.jsp" >
	<c:param name="menu" value="1" />
</c:import>
<div class="container">
	<div id="content">
		<div class="teaser alt">
			<div class="container"> </div>
			<!-- / container --> 
		</div>
		<div class="wrapper-content">
			<div class="wrapper-content-title">
				<div class="category"> <a class="selected tag" href="#">${lableName}</a>
				<c:if test="${attenedLable}">
					<a class="followed addorcancel" href="#" onclick="dealLaleRelation('cancel')">贴条</a>
				</c:if>
				<c:if test="${not attenedLable}">
					<a class="follow addorcancel" href="#" onclick="dealLaleRelation('add')">贴条</a>
				</c:if>
				</div>
			</div>
			<ol class="stream">
			</ol>
			<div class="inside-content" id="commodity_info_id"></div>
			<!-- / content --> 
		</div>
	</div>
	<%@ include file="/jsp/fg/include/default_foot.jsp"%>	
</div>
<div id="fb-root"> </div>
</body>
</html>